﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Text;
using System.Data;
using AspNetCs.Bll;

public partial class control_ServiceListMenu : BaseControl
{
    //客户服务文章类别编号
    protected int customerSeviceClassId = 10;

    protected void Page_Load(object sender, EventArgs e)
    {

    }
    /// <summary>
    /// 客户服务文章显示
    /// </summary>
    /// <returns></returns>
    public string DisplayCustomerSeviceList()
    {
        StringBuilder sb = new StringBuilder();
        DataTable dataTable = new DataTable();
        dataTable = GetCustomerSeviceList();
        sb.Append("<ul>");
        sb.Append("<li><img src='" + configInfo.InstallDir + "Images/tree_folder4.gif'><strong>客服中心</strong></li>");
        foreach (DataRow row in dataTable.Rows)
        {
            sb.AppendFormat("<li><img src='" + configInfo.InstallDir + "Images/tree_line1.gif' /><img src='" + configInfo.InstallDir + "Images/tree_folder3.gif' /><a href='{0}'  target='_blank'  >{1}</a></li>", configInfo.InstallDir + "CustomerSeviceList_" + row["ClassId"].ToString() + ".aspx", row["className"].ToString());
            //sb.AppendFormat("<li><a href='{0}'><img src='{1}' />{2}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[{3}]</a></li>", configInfo.InstallDir + "NewsInfoShow_" + customerSeviceClassId + "_" + row["ArticleId"] + ".aspx", StringHelper.isNumber_int(row["IsTop"].ToString()) == 0 ? configInfo.InstallDir + "Images/article_common.gif" : configInfo.InstallDir + "Images/article_ontop.gif", row["Title"].ToString(), row["UpdateTime"].ToString());
        }
        sb.Append("</ul>");
        return sb.ToString();
    }


    /// <summary>
    /// 客户服务文章
    /// </summary>
    /// <returns></returns>
    public DataTable GetCustomerSeviceList()
    {
        DataTable dataTable = new DataTable();
        string cmdText = "select className,classId from ArticleClass where parentId={0}";
        cmdText = string.Format(cmdText, customerSeviceClassId);
        dataTable = ExcuteSqlTextBLL.GetDataTable(cmdText);
        return dataTable;
    }
}
